如何基于 openvsx 构建自己业务的应用市场?

product.json

{
  nameShort: platform + "1s",
  nameLong: platform + "1s",
  applicationName: platform + "1s",
  reportIssueUrl: "https://github.com/conwnet/github1s/issues/new",
  extensionsGallery: {
    serviceUrl: "https://marketplace.visualstudio.com/_apis/public/gallery",
    cacheUrl: "https://vscode.blob.core.windows.net/gallery/index",
    itemUrl: "https://marketplace.visualstudio.com/items",
    resourceUrlTemplate:
      window.location.origin +
      "/api/vscode-unpkg/{publisher}/{name}/{version}/{path}",
    controlUrl: "https://az764295.vo.msecnd.net/extensions/marketplace.json",
    recommendationsUrl:
      "https://az764295.vo.msecnd.net/extensions/workspaceRecommendations.json.gz",
    nlsBaseUrl: "",
    publisherUrl: "",
  },
}

通过修改 IDE product.json 文件中 extensionsGallery.serviceUrl & extensionsGallery.itemUrl & linkProtectionTrustedDomains 节点的值,让 IDE 链接应用市场时改变 API 指向达到链接 SmartIDE 插件市场的目的。

"extensionsGallery": {
    "serviceUrl": "https://marketplace.smartide.cn/vscode/gallery",
    "itemUrl": "https://marketplace.smartide.cn/vscode/item"
}

"linkProtectionTrustedDomains": [
    "https://marketplace.smartide.cn"
]

插件代理地址

https://github.com/conwnet/github1s/blob/master/api/vscode-unpkg/package.json

SmartIDE 插件市场

SmartIDE 插件市场 是蚂蚁的同学针对国内使用类 VSCode IDE 的开发者提供的开源插件市场镜像服务,我们将 open-vsx.org 的国外站点通过 Github Action 自动同步到了部署在国内的站点中,经我们自己测试速度提升 2-5 倍。

针对中国开发者的使用习惯和网络状况对这个开源项目进行了本地化,包括:界面的中文翻译处理和将插件同步到中国大陆的地址上供开发者下载使用。同时,对于无法直接使用微软官方 marketplace 的类 VSCode IDE 来说,比如:Codium, Code Server 和 OpenVSCode Server 这些 VSCode fork,可以使用 SmartIDE 插件市场作为自己的插件市场,方便这些工具的使用者获取与 VSCode 类似的插件安装体验。

应用市场插件

兼容?外部插件兼容

Last Updated:
Contributors: yiliang114